<template>
  <div>
    <HomeHeader></HomeHeader>
    <Swiper></Swiper>
    <Icons  :iconList = "iconList"></Icons>
    <Recommend></Recommend>
  </div>
</template>

<script>
import HomeHeader from "./components/HomeHeader"
import Swiper from "./components/swiper"
import Icons from "./components/icons "
import axios from "axios"
export default {
    name:"Home",
  components:{
            HomeHeader,
            Swiper,
            Icons,
            
  },
  props: {

  },
  data() { 
    return {
 city : "",
                swiperList : [],
                iconList : [],
                recommendList : [],
                weekendList : []
            
    }
  },
 watch:{
  },
computed:{},
  methods:{
getHomeInfo(){
                axios.get("/static/mock/index.json")
                .then(this.getHomeInfoSucc)
            },
            getHomeInfoSucc(res){
                res = res.data
                console.log(res.data);
                if (res.ret && res.data) {
                    const data = res.data
                    this.city = data.city
                    this.swiperList = data.swiperList
                    this.iconList = data.iconList
                    this.recommendList = data.recommendList
                    this.weekendList = data.weekendList
                }
            }
  },
created(){
  },
mounted(){
     this.getHomeInfo();
  },
 }
</script>

<style lang="stylus" scoped>
 
</style>